import React, { Component } from 'react'
import { Button } from 'antd'
import { withRouter } from 'react-router-dom'
class Header extends Component {
    forward = () => {
        this.props.history.goForward()
    }
    back = () => {
        this.props.history.goBack()
    }
    go = () => {
        this.props.history.go(1)
    }
    render() {
        return (
            <div>
                React Route Demo
                <Button onClick={this.forward}>前进</Button>
                <Button onClick={this.back}>后退</Button>
                <Button onClick={this.go}>go</Button>
            </div>
        )
    }
}

export default withRouter(Header)